#pragma once

#include "Event.h"


namespace Origin
{
    class ORIGIN_API MouseMovedEvent: public Event
    {
    public:

        MouseMovedEvent(float x, float y) : _mouseX(x), _mouseY(y) {}

        inline float GetX() const { return _mouseX; }
        inline float GetY() const { return _mouseY; }

        EVENT_CLASS_TYPE(MouseMoved)
        EVENT_CLASS_CATEGORY(MouseEventCategory|InputEventCategory)

        std::string ToString() const override
        {
            std::stringstream ss;
            ss << "MouseMovedEvent:" << _mouseX << ", " << _mouseY;
            return ss.str();
        }

    private:
        float _mouseX, _mouseY;
    };

    class ORIGIN_API MouseScrolledEvent: public Event
    {
    public:
        MouseScrolledEvent(float x, float y): _xOffset(x), _yOffset(y) { }

        inline float GetXOffset() const { return _xOffset; }
        inline float GetYOffset() const { return _yOffset; }

        std::string ToString() const override
        {
            std::stringstream ss;
            ss << "MouseScrolledEvent:" << _xOffset << ", " << _yOffset;
            return ss.str();
        }

        EVENT_CLASS_TYPE(MouseScrolled)
        EVENT_CLASS_CATEGORY(MouseEventCategory|InputEventCategory)

    private:
        float _xOffset, _yOffset;
    };


    class ORIGIN_API MouseButtonEvent : public Event
    {
    public:
        inline int GetMouseButton() const { return _button; }
        EVENT_CLASS_CATEGORY(MouseButtonEventCategory|InputEventCategory)

    protected:
        MouseButtonEvent(int button) : _button(button) {}
        int _button;
    };


    class ORIGIN_API MouseButtonPressedEvent: public MouseButtonEvent
    {
    public:
        MouseButtonPressedEvent(int button): MouseButtonEvent(button) {}

        virtual std::string ToString() const override {
            std::stringstream ss;
            ss << "MouseButtonPressedEvent:" << _button;
            return ss.str();
        }

        EVENT_CLASS_TYPE(MouseButtonPressed)
    };

    class ORIGIN_API MouseButtonReleasedEvent: public MouseButtonEvent
    {
    public:
        MouseButtonReleasedEvent(int button) : MouseButtonEvent(button) {}

        virtual std::string ToString() const override {
            std::stringstream ss;
            ss << "MouseButtonReleasedEvent:" << _button;
            return ss.str();
        }

        EVENT_CLASS_TYPE(MouseButtonReleased)
    };

}